FROM golang:1.18-alpine3.15 AS build

RUN mkdir /web01
COPY . /web01
WORKDIR /web01
ENV GO111MODULE=on \
    GOPROXY=https://goproxy.cn
RUN CGO_ENABLED=0 GOOS=linux go build -o web01


FROM alpine:3.15 as final

# 时区
RUN apk --no-cache add tzdata
ENV TZ=Asia/Shanghai
COPY --from=build /web01/web01 /web01/web01.yaml /
EXPOSE 8080

CMD ["/web01"]